<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" href="favicon.ico">
    <title>控制台</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/main.css">
    <link rel="stylesheet" href="css/pagination.css"/>
    <script type="text/javascript" src="jquery/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="jquery/jquery.pagination.js"></script>
    <script type="text/javascript" src="script/docs.min.js"></script>
    <script type="text/javascript" src="script/back-to-top.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target="#navbar" aria-expanded="false"
                    aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#" style="color: lawngreen">
                <i class="glyphicon glyphicon-user"></i>${adminInfo.adminName}</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="getAllTypeGoods">首页</a></li>
                <li><a href="#">second</a></li>
                <li><a href="#">third</a></li>
                <li><a href="adminLogout">退出</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar" id="select">
                <li class="flag"><a href="getAllGoodsMutiFunction">商品管理</a></li>
                <li class="active flag"><a href="getAllTypes">商品分类管理</a></li>
                <li class="flag"><a href="getAllUserInfo">用户信息</a></li>
                <li class="flag"><a href="#">展示</a></li>
            </ul>
        </div>
        <script>
            $(function () {
                $("#select .flag").click(function () {
                    $("#select .flag").removeClass("active");
                    $(this).addClass("active");
                })
            })
        </script>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title" align="center">
                        <i class="glyphicon glyphicon-th"></i> 白给店铺控制台
                    </h3>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>类型编号</th>
                                <th>类型名称</th>
                                <th width="5%">
                                    <button class="btn btn-success" data-toggle="modal"
                                            data-target="#myAdd" add="0">添加
                                    </button>
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${typeList}" var="t">
                                <tr>
                                    <td>${t.tid}</td>
                                    <td>${t.tname}</td>
                                </tr>
                            </c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade" id="myAdd" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myAddLabel">添加页面</h4>
            </div>
            <div class="modal-body">
                <form action="addNewType" method="post" id="add">
                    <div class="input-group">
                        <span class="input-group-addon">新增类别</span>
                        <input type="text" class="form-control" name="tname">
                    </div>
                    <div class="input-group">
                        <input type="submit" class="form-control" value="添加">
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>
